<?php
class SicksController extends AppController{
	public function add(){
		$this->illness();
	}
	private function illness(){	
		App::import('Vendor','excel');	
		$data = new Spreadsheet_Excel_Reader("illness.xls");			
		
		$rowcount=$data->rowcount();
		$colcount=$data->colcount();
			
		for($r=2; $r<=$rowcount; $r++){
			$code="";$description="";$rvu="";$case="";
			for($c=1; $c<=$colcount; $c++){
				if($c==1){$code=$data->val($r, $c);}
				else if($c==2){$description=$data->val($r, $c);}
				else if($c==3){$rvu=$data->val($r, $c);}
				else if($c==4){$case=$data->val($r, $c);}				
			}			
			$this->data['Sick']['code']=$code;
			$this->data['Sick']['description']=$description;
			$this->data['Sick']['rvu']=$rvu;
			$this->data['Sick']['case']=$case;			
			
			$this->Sick->create();
			$this->Sick->save($this->data);		
		}
	}
}
?>